package edu.pku.sei.transformation.tgg.adapter;

import edu.pku.sei.transformation.editor.model.Expression;
import edu.pku.sei.transformation.tgg.rule.IConstraint;
import edu.pku.sei.transformation.tgg.rule.INode;

public class ConstraintAdapter implements IConstraint {
	protected Expression element;
	protected INode ownedNode;

	public ConstraintAdapter(Expression element, INode owner) {
		this.element = element;
		this.ownedNode = owner;
	}

	@Override
	public String getExpression() {
		return element.getExp();
	}

	@Override
	public INode getNode() {
		return ownedNode;
	}

	@Override
	public String getID() {
		return String.valueOf(element.getElementID());
	}

}
